package com.gaohe.post.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.post.mapper.FmPostCategorizeMapper;
import com.gaohe.post.domain.FmPostCategorize;
import com.gaohe.post.service.IFmPostCategorizeService;

/**
 * 帖子分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmPostCategorizeServiceImpl implements IFmPostCategorizeService 
{
    @Autowired
    private FmPostCategorizeMapper fmPostCategorizeMapper;

    /**
     * 查询帖子分类
     * 
     * @param postCategorizeId 帖子分类主键
     * @return 帖子分类
     */
    @Override
    public FmPostCategorize selectFmPostCategorizeByPostCategorizeId(Long postCategorizeId)
    {
        return fmPostCategorizeMapper.selectFmPostCategorizeByPostCategorizeId(postCategorizeId);
    }

    /**
     * 查询帖子分类列表
     * 
     * @param fmPostCategorize 帖子分类
     * @return 帖子分类
     */
    @Override
    public List<FmPostCategorize> selectFmPostCategorizeList(FmPostCategorize fmPostCategorize)
    {
        return fmPostCategorizeMapper.selectFmPostCategorizeList(fmPostCategorize);
    }

    /**
     * 新增帖子分类
     * 
     * @param fmPostCategorize 帖子分类
     * @return 结果
     */
    @Override
    public int insertFmPostCategorize(FmPostCategorize fmPostCategorize)
    {
        fmPostCategorize.setCreateTime(DateUtils.getNowDate());
        return fmPostCategorizeMapper.insertFmPostCategorize(fmPostCategorize);
    }

    /**
     * 修改帖子分类
     * 
     * @param fmPostCategorize 帖子分类
     * @return 结果
     */
    @Override
    public int updateFmPostCategorize(FmPostCategorize fmPostCategorize)
    {
        fmPostCategorize.setUpdateTime(DateUtils.getNowDate());
        return fmPostCategorizeMapper.updateFmPostCategorize(fmPostCategorize);
    }

    /**
     * 批量删除帖子分类
     * 
     * @param postCategorizeIds 需要删除的帖子分类主键
     * @return 结果
     */
    @Override
    public int deleteFmPostCategorizeByPostCategorizeIds(Long[] postCategorizeIds)
    {
        return fmPostCategorizeMapper.deleteFmPostCategorizeByPostCategorizeIds(postCategorizeIds);
    }

    /**
     * 删除帖子分类信息
     * 
     * @param postCategorizeId 帖子分类主键
     * @return 结果
     */
    @Override
    public int deleteFmPostCategorizeByPostCategorizeId(Long postCategorizeId)
    {
        return fmPostCategorizeMapper.deleteFmPostCategorizeByPostCategorizeId(postCategorizeId);
    }
}
